/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mb;

import beans.CarrinhoBeanRemote;
import beans.CompraBeanRemote;
import entidade.Cliente;
import javax.ejb.EJB;

/**
 *
 * @author lsalves
 */
public class CompraMB {
   
    @EJB
    private CompraBeanRemote compraBean;
    @EJB
    private CarrinhoBeanRemote carrinhoBean;
    
    public String efetivarCompra(){
        
        System.out.print("Efetivar Compra");
        
        //Cliente cli = (Cliente)carrinhoBean.getCliente();
        //System.out.print("Cliente" + cli.getNome());
        //System.out.print("Cliente" + cli.getId());
        Cliente cli = new Cliente();
        cli.setId(Long.valueOf("1"));
        cli.setNome("Leandro Da Silva");
        compraBean.efetivarCompra(carrinhoBean.listarProdutoCarrinho(), cli);
        
        return "/com/final/Final.xhtml";
        
    }
    
}
